<template>
  <div class="error-container">
    <img class="error-image" src="@/assets/img/404.png" alt="404">
    <div class="text main-text">出错了...页面失踪了</div>
    <div class="button-container">
      <el-button type="primary" @click="back()" icon="el-icon-back">返回</el-button>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    back() {
      window.history.length > 1 ? this.$router.go(-1) : this.$router.push("/");
    }
  }
};
</script>

<style lang="scss" scoped>
.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background-color: #f5f7fa;
  
  .error-image {
    width: 250px;
    height: 250px;
    margin-bottom: 30px;
  }
  
  .main-text {
    font-size: 28px;
    font-weight: bold;
    color: #606266;
    margin-bottom: 30px;
  }
  
  .button-container {
    .el-button {
      padding: 12px 24px;
      font-size: 16px;
    }
  }
}
</style>

